package com.prs.crm.action.crm;

import java.util.Collection;

import org.courser.struts.BaseAction;

import com.prs.crm.context.AppContext;
import com.prs.crm.domain.crm.Liaison;
import com.prs.crm.domain.crm.Linkman;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.service.crm.CustomerAppointService;

/**
 * 客户管理首页
 * @author prs.chenzhi
 *
 */
public class IndexAction extends BaseAction{

	private static final long serialVersionUID = 1L;
	
	private CustomerAppointService customerAppointService;
	
	private Collection<Linkman> birthdayLinkmans;
	private Collection<Liaison> dueLiaisons;
	
	public void setBirthdayLinkmans(Collection<Linkman> birthdayLinkmans) {
		this.birthdayLinkmans = birthdayLinkmans;
	}

	public Collection<Linkman> getBirthdayLinkmans() {
		return birthdayLinkmans;
	}

	public void setCustomerAppointService(CustomerAppointService customerAppointService) {
		this.customerAppointService = customerAppointService;
	}

	public CustomerAppointService getCustomerAppointService() {
		return customerAppointService;
	}
	
	public void setDueLiaisons(Collection<Liaison> dueLiaisons) {
		this.dueLiaisons = dueLiaisons;
	}

	public Collection<Liaison> getDueLiaisons() {
		return dueLiaisons;
	}
	
	public String execute()
	{
		Person person = AppContext.getAccountContext().currentUser();
		this.setBirthdayLinkmans(this.getCustomerAppointService().getTodayBirthdayLinkman4Appoint(person));
		this.setDueLiaisons(this.getCustomerAppointService().getTodayDueLiaison4Appoint(person));
		return SUCCESS;
	}





}
